#version 300 es
precision mediump float;

in vec4 v_color;
in vec2 v_texCoord;

uniform sampler2D u_texture;
uniform float u_time;  // 唯一的时间变量

out vec4 fragColor;

void main() {
    vec4 texColor = texture(u_texture, v_texCoord);

    // 简单的时间效果 - 颜色轻微脉动
    float pulse = (sin(u_time)*0.5+0.5);
    vec3 finalColor = max(texColor.rgb * v_color.rgb * pulse, 0.0);

    fragColor = vec4(finalColor, texColor.a);
}
